package com.matt.repository.impl;

import com.matt.foundation.vo.ProductTypeVo;
import com.matt.repository.base.BaseNativeSqlRepository;
import com.matt.repository.base.ProductNativeRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/12/17
 * *******************************
 */
@Slf4j
@Service
public class ProductNativeRepositoryImpl extends BaseNativeSqlRepository implements ProductNativeRepository {


    @Override
    public List<ProductTypeVo> getTypeByAreaId(String areaId) {
        String querySql = String.format("select type as type,name as name from product where isVisible=1 and areaId ='%s'",areaId);
        return sqlObjectList(querySql,ProductTypeVo.class);
    }
}
